package com.web.mapper;

import com.web.entity.Product;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ProductMapper {

    @Select("select * from product")
    public List<Product> list();

    @Select("select * from product where id=#{id}")
    public Product get(Integer id);

    @Insert("insert into product(name,price,num,remark) values(#{name},#{price},#{num},#{remark})")
    public void add(Product product);

    @Update("update product set name=#{name},price=#{price},num=#{num},remark=#{remark} where id=#{id}")
    public void update(Product product);

    @Delete("delete from product where id=#{id}")
    public void delete(Integer id);

}
